<%@ Control Language="c#" Inherits="ASPNET.StarterKit.IssueTracker.DisplayIssues" CodeFile="DisplayIssues.ascx.cs" %>
<%@ Register TagPrefix="it" TagName="TextImage" Src="~/UserControls/TextImage.ascx" %>
<script runat="server">

</script>
<asp:DataGrid PageSize="20" id="grdIssues" allowpaging="True" BorderColor="White" BorderStyle="None"
	Width="100%" CellPadding="2" AutoGenerateColumns="False" AllowSorting="True" runat="server">
	<headerstyle cssclass="gridHeader"></headerstyle>
	<columns>
                <asp:templatecolumn SortExpression="Id" HeaderText="ID">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle cssclass="gridFirstItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "Id")%>
                    </itemtemplate>
                </asp:templatecolumn>
                <asp:hyperlinkcolumn DataNavigateUrlField="Id" DataNavigateUrlFormatString="~/Issues/IssueDetail.aspx?id={0}" DataTextField="Title" SortExpression="Title" HeaderText="Issue (click title to view details)">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle cssclass="gridItem"></itemstyle>
                </asp:hyperlinkcolumn>

                <asp:templatecolumn SortExpression="Category" HeaderText="Category" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "CategoryName")%>
                    </itemtemplate>
                </asp:templatecolumn>
                <asp:templatecolumn SortExpression="Creator" HeaderText="Creator" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "CreatorDisplayName")%>
                    </itemtemplate>
                </asp:templatecolumn>


                <asp:templatecolumn SortExpression="Owner" HeaderText="Owner" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "OwnerDisplayName")%>
                    </itemtemplate>
                </asp:templatecolumn>

                <asp:templatecolumn SortExpression="Assigned" HeaderText="Assigned" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "AssignedDisplayName" )%>
                    </itemtemplate>
                </asp:templatecolumn>
                <asp:templatecolumn SortExpression="Milestone" HeaderText="Milestone" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<it:TextImage id="ctlMilestone" Text='<%# DataBinder.Eval(Container.DataItem, "MilestoneName" )%>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "MilestoneImageUrl" )%>' ImageDirectory="/Milestone" Runat="Server" />
                    </itemtemplate>
                </asp:templatecolumn>

                <asp:templatecolumn SortExpression="Status" HeaderText="Status" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<it:TextImage id="ctlStatus" Text='<%# DataBinder.Eval(Container.DataItem, "StatusName" )%>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "StatusImageUrl" )%>' ImageDirectory="/Status" Runat="Server" />
                    </itemtemplate>
                </asp:templatecolumn>

                <asp:templatecolumn SortExpression="Priority" HeaderText="Priority" Visible="false">
                    <headerstyle horizontalalign="Left" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Left" cssclass="gridItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<it:TextImage id="ctlPriority" Text='<%# DataBinder.Eval(Container.DataItem, "PriorityName" )%>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PriorityImageUrl" )%>' ImageDirectory="/Priority" Runat="Server" />
                    </itemtemplate>
                </asp:templatecolumn>

                <asp:templatecolumn SortExpression="Created" HeaderText="Created">
                    <headerstyle horizontalalign="Right" cssclass="gridHeader"></headerstyle>
                    <itemstyle horizontalalign="Right" cssclass="gridLastItem"></itemstyle>
                    <itemtemplate>
                        &nbsp;<%# DataBinder.Eval(Container.DataItem, "DateCreated", "{0:d}")%>
                    </itemtemplate>
                </asp:templatecolumn>
	</columns>
	<pagerstyle horizontalalign="Center"></pagerstyle>
</asp:DataGrid>
<asp:Label id="lblNoIssues" Visible="false" Runat="Server">No Matching Issues</asp:Label>
<table id="tblOptions" width="100%" visible="false" runat="server">
	<tr>
		<td>
			<asp:LinkButton Text="Select Columns" Runat="server" id="LinkButton1" onclick="SelectColumnsClick" />
		</td>
		<td align="right">
			<asp:Label id="lblIssues" Runat="Server">(Sort the results by clicking the column headings)</asp:Label>
		</td>
	</tr>
</table>
<asp:Panel id="pnlSelectColumns" Visible="false" runat="Server">
	<BR>
	<BR>
	<TABLE borderColor="black" cellSpacing="0" cellPadding="4" border="1">
		<TR>
			<TD>
				<asp:CheckBoxList id="lstIssueColumns" Runat="Server" RepeatDirection="Horizontal">
					<asp:ListItem Text="Category" Value="2" />
					<asp:ListItem Text="Creator" Value="3" />
					<asp:ListItem Text="Owner" Value="4" />
					<asp:ListItem Text="Assigned" Value="5" />
					<asp:ListItem Text="Milestone" Value="6" />
					<asp:ListItem Text="Status" Value="7" />
					<asp:ListItem Text="Priority" Value="8" />
					<asp:ListItem Text="Created" Value="9" />
				</asp:CheckBoxList><BR>
				<asp:Button id="Button1" Runat="server" Text="Save" CssClass="standardText" onclick="SaveClick"></asp:Button>&nbsp;&nbsp;
				<asp:Button id="Button2" Runat="server" Text="Cancel" CssClass="standardText" onclick="CancelClick"></asp:Button></TD>
		</TR>
	</TABLE>
</asp:Panel>
